﻿using UnityEngine;
using System.Collections;

public class MapManager : SingletonMono<MapManager>
{
    AllMapData allMapData;

    public AllMapData GetMapData()
    {
        if (allMapData == null)
            LoadMapData();
        return allMapData;
    }
    public void LoadMapData()
    {
        allMapData = ResMgr.Instantce.LoadJsonData<AllMapData>();
        if(allMapData == null)
        {
            allMapData = new AllMapData();
            allMapData.allMap.Add(new MapData() {  mapId = 10001, mapName = "测试地图", mapScene = "Level01", maxPlayer = 4, Intro = "这是一个你没有玩过的全新版本！"});
           // allMapData.allMap.Add(new MapData() { mapId = 10002, mapName = "测试地图2", mapScene = "testScene2", maxPlayer = 4, Intro = "传奇世界，你值得拥有" });
        }
    }

    //public void SaveMapData()
    //{
    //    ResMgr.Instantce.SaveJsonData<AllMapData>(allMapData);
    //}
}
